(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/scripts/huochai/MainMenu.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '521eeZ/rGFBtYMva+MfBMJ6', 'MainMenu', __filename);
// scripts/huochai/MainMenu.js

'use strict';

var isMusicOn = false;
cc.Class({
    extends: cc.Component,

    properties: {
        audioMng: cc.Node,
        btnMusic: cc.Sprite,
        texMusicOn: cc.SpriteFrame,
        texMusicOff: cc.SpriteFrame
    },

    // use this for initialization
    onLoad: function onLoad() {
        this.audioMng = this.audioMng.getComponent('AudioMng');
        /*
        if (isMusicOn == false)
        {
            isMusicOn = true;
            this.audioMng.playMusic();
        }*/

        //this.SpriteRankingList.Node.active = false;
        cc.director.preloadScene('maingame', function () {
            cc.log('Next scene preloaded');
        });
    },

    // use this for initialization
    init: function init(betDuration) {
        this.SpriteRankingList.active = false;
    },

    playGame: function playGame() {
        cc.director.loadScene('maingame'); //('maingame');
    },
    showRankingList: function showRankingList() {
        //cc.director.loadScene('table');
        this.SpriteRankingList.active = true;
    },

    onButtonClicked: function onButtonClicked() {
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
            wx.shareAppMessage({
                title: '我要主动拉起分享啦',
                success: function success(shareTickets, groupMsgInfos) {
                    console.log('主动成功');
                },
                fail: function fail(res) {
                    console.log('主动失败');console.log(res);
                }
            });

            //wx.clearStorageSync();
        }
    },

    OnButtonCustomerClicked: function OnButtonCustomerClicked() {
        if (cc.sys.platform == cc.sys.WECHAT_GAME) {
            wx.openCustomerServiceConversation({
                sessionFrom: '火柴谜题',
                showMessageCard: false,
                sendMessageTitle: '这是一个会话内消息卡片标题',
                sendMessagePath: '会话内消息路径',
                sendMessageImg: '会话内消息卡片图片路径',
                success: function success() {
                    console.log('客服调用成功');
                },
                fail: function fail() {
                    console.log('接口调用失败的回调函数');
                },
                complete: function complete() {
                    console.log('回调函数');
                }
            });
        }
    },

    // 音乐开关
    OnButtonMucsicClicked: function OnButtonMucsicClicked() {
        isMusicOn = !isMusicOn;
        if (isMusicOn == false) {
            this.audioMng.stopMusic();
            this.btnMusic.spriteFrame = this.texMusicOff;
        } else {
            this.audioMng.playMusic();
            this.btnMusic.spriteFrame = this.texMusicOn;
        }
    },

    // called every frame
    update: function update(dt) {}
});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=MainMenu.js.map
        